﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;

namespace ULog.Filters
{
    /// <summary>
    /// 定义用户对象的基本功能
    /// </summary>
    public class APIPrincipal : IPrincipal
    {      
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="iIdentity"></param>
        public APIPrincipal(IIdentity iIdentity)
        {
            Identity = iIdentity;
        }

        /// <summary>
        /// 获取当前用户的标识
        /// </summary>
        public IIdentity Identity
        {
            get;
        }

        /// <summary>
        ///  确定当前用户是否属于指定的角色
        /// </summary>
        /// <param name="role">要检查其成员资格的角色的名称</param>
        /// <returns>如果当前用户是指定角色的成员，则为 true；否则为 false。</returns>
        public bool IsInRole(string role)
        {
            return true;
        }
    }
}